<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateOrderDeclareTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('order_declare', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('order_id')->comment('订单ID');
            $table->unsignedTinyInteger('status')->default(0)->comment('是否成功|["否","是"]');
            $table->string('url')->comment('请求路径');
            $table->string('request_type')->comment('请求方式');
            $table->json('request')->nullable()->comment('请求参数');
            $table->json('response')->nullable()->comment('响应参数');
            $table->timestampsTz();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('order_declare');
    }
}
